package ar.edu.unq.wannaplay.panels.employee;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.ListMultipleChoice;
import org.apache.wicket.markup.html.panel.Panel;

import ar.edu.unq.wannaplay.dtos.EmployeeDTO;
import ar.edu.unq.wannaplay.dtos.LicenceDTO;
import ar.edu.unq.wannaplay.dtos.SkillDTO;

public class SingleEmployeeViewPanel extends Panel {

    private static final long serialVersionUID = 1L;

    private EmployeeDTO modelObject;

    public SingleEmployeeViewPanel(final String id, final EmployeeDTO modelObject) {
        super(id);
        this.modelObject = modelObject;
        this.initialize();
    }

    private void initialize() {

        this.add(new Label("name", modelObject.getName()));
        this.add(new Label("surname", modelObject.getSurname()));
        this.add(new Label("email", modelObject.getEmail()));
        this.add(new Label("telephone", modelObject.getTelephone()));
        this.add(new Label("dni", modelObject.getDni()));
        this.add(new Label("town", modelObject.getTown()));
        this.add(new Label("university", modelObject.getUniversity()));

        this.add(new ListMultipleChoice<SkillDTO>("skillList", modelObject.getSkills()));

        this.add(new ListMultipleChoice<LicenceDTO>("licenceList", modelObject.getLicences()));
    }

    public EmployeeDTO getModelObject() {
        return modelObject;
    }

    public void setModelObject(final EmployeeDTO modelObject) {
        this.modelObject = modelObject;
    }
}
